package lesson2.com.demo;

import lesson2.com.marvel.KryptoniteException;
import java.io.FileNotFoundException;

public class ExceptionTester {

    // "main" is Curley
    public static void main(String[] args) {
        System.out.println("In main");
        ExceptionDemo ed = new ExceptionDemo();
        try {  // try block is "suspect code"
             ed.f();  // declare or handle
            ed.g(45); // declare or handle
            
 
        }catch (FileNotFoundException  ex) {
             
              logIt(ex);
        }finally{
            System.out.println("I get executed good or bad :)");
        }
        System.out.println("End main");
    }
    
    /*
     *       // Multi-catch is Java 7 and above only!
        }catch (FileNotFoundException | NullPointerException | KryptoniteException ex) {
                // all three caught  here
              logIt(ex);
        }
     */
    
    private static void logIt(Throwable t){
        
    }
}
